﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BluePortal.Framework
{
    [DataContract]
    public class FindResult<T> : IEnumerable<T>
    {
        private IEnumerable<T> enumerable = null;
        public FindResult(IEnumerable<T> enumerable) { this.enumerable = enumerable; }
        public FindResult() { }

        [DataMember]
        public IEnumerable<T> Enumerable { get { return enumerable; } set { this.enumerable = value; } }

        private int? totalCount;
        [DataMember]
        public int? TotalCount { get { return totalCount; } set { totalCount = value; } }

        #region IEnumerable<T> Members

        public IEnumerator<T> GetEnumerator()
        {
            return enumerable.GetEnumerator();
        }

        #endregion

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return enumerable.GetEnumerator();
        }

        #endregion
    }

}
